/**
 * 
 */
package com.ruleengine.instruction.impl;

import java.util.ArrayList;
import java.util.List;

import com.ruleengine.instruction.InstructionType;

/**
 * 抛出异常指令.
 * 该指令专门用于实现finally块的逻辑，只是一个占位符指令。
 * @author wuxiao
 *
 * Created on Apr 17, 2012
 */
public class ResetFromFinallyInstruction extends BaseInstruction {
    private List<Integer> jumpInstructionIndex = new ArrayList<Integer>();
    
    public ResetFromFinallyInstruction() {
        super(InstructionType.RESETFROMFINALLY);
    }
    
    public void addJumpInstructionIndex(int index){
        jumpInstructionIndex.add(index);
    }
    
    public boolean isContain(int index){
        for(Integer i : jumpInstructionIndex){
            if(i==index){
                return true;
            }
        }
        return false;
    }
    
    @Override
    public String toString() {
        return "{" + super.toString() + "," + jumpInstructionIndex+"}";
    }

}
